import vue from '@vitejs/plugin-vue'

import { defineConfig, UserConfigExport, ConfigEnv } from 'vite'
import Components from 'unplugin-vue-components/vite'
import { VantResolver } from 'unplugin-vue-components/resolvers'

// https://vitejs.dev/config/
export default ({ command }: ConfigEnv): UserConfigExport => defineConfig({
  plugins: [
    vue(),
    Components({
      resolvers: [VantResolver()],
    }),
  ],
  // 服务器配置
  server: {
    port: 9090,
    host: '0.0.0.0',
    // 反向代理解决跨域
    proxy: {
      '/api/v1/doctor/': {
        // target: 'http://localhost:10777'
        target: 'http://10.7.164.51:10777'
      }
    }
  }
})
